package com.sinog.core.util;

import com.sinog.core.utilbean.Constants;
import java.util.HashMap;
import java.util.Map;

/**
 * @desc 组装转换参数
 * @author wangxj
 * @date 2022-08-23-15:10
 */
public class AssemblyConversionUtils {

    /**
     * 根据level转换参数
     * @param level 用户level
     * @return Map<String,Object>
     */
    public static Map<String,Object> transferAssembly(String level) {
        Map<String,Object> resultMap = new HashMap<>(16);
        String hjCode = "";
        String jzdCode = "";
        String secondHjCode = "";
        String pdanweiCode = "";
        if(Constants.OrgLevel.LEVEL_SFS.equals(level)) {
            hjCode = "nativevill";
            jzdCode = "placevill";
            secondHjCode = "second_street";
        } else if(Constants.OrgLevel.LEVEL_QXSFJ.equals(level)) {
            hjCode = "nativecou";
            jzdCode = "placecou";
            secondHjCode = "second_county";
        } else if(Constants.OrgLevel.LEVEL_DSSFJ.equals(level)) {
            hjCode = "nativecity";
            jzdCode = "placecity";
            secondHjCode = "second_city";
        } else if(Constants.OrgLevel.LEVEL_SFT.equals(level)) {
            hjCode = "nativepro";
            jzdCode = "placepro";
            secondHjCode = "second_province";
        } else if(StrUtil.containsEquals(level,Constants.OrgLevel.LEVEL_JY,Constants.OrgLevel.LEVEL_KSS,Constants.OrgLevel.LEVEL_SJZX)) {
            pdanweiCode = "pdanwei";
        } else if(Constants.OrgLevel.LEVEL_JYJ.equals(level)) {
            pdanweiCode = "prison_father";
        }
        resultMap.put("hjCode",hjCode);
        resultMap.put("jzdCode",jzdCode);
        resultMap.put("secondHjCode",secondHjCode);
        resultMap.put("pdanweiCode",pdanweiCode);
        return resultMap;
    }
}